<?php

namespace App\Http\Controllers\Api\V1;

use App\Models\Product;
use App\Models\User;
use App\Models\Circle;

class InvitesController extends Controller
{
	public function inviteString(Product $product = null)
	{
		$string = request()->user()->inviteString($product);
		return response()->json(['invite_string' => $string]);
	}

	public function userPoster()
	{
        /**
         * @var User $user
         */
        $user = request()->user();
		$poster = $user->userInvitePoster();
		return response()->json(['user_invite_poster' => $poster]);
	}

	public function productPoster(Product $product)
	{
		$poster = request()->user()->productInvitePoster($product);
		return response()->json(['product_invite_poster' => $poster]);
	}

	public function circlePoster(Circle $circle)
	{
		
		$poster = request()->user()->circleInvitePoster($circle);
		return response()->json(['circle_invite_poster' => $poster]);
	}


}
